<HTML>
<HEAD><TITLE>g4</TITLE></HEAD>
<BODY><H1>g4</H1>
Connect to the g4 to sample from it<BR><BR>
<TABLE border="1">
<TR><TD>Name</TD><TD>Required</TD><TD>Type</TD><TD>Default value</TD><TD>Description</TD>
<TR><TD>server</TD><TD>Yes</TD><TD>string</TD><TD>'localhost'</TD><TD>Location of the server (e.g. 'localhost' or an IP address) </TD></TR>
<TR><TD>port</TD><TD>Yes</TD><TD><A title="A single number (i.e. not a matrix)">number</A></TD><TD>0</TD><TD>Port to connect to the server on</TD></TR>
<TR><TD>showPositionType</TD><TD>No</TD><TD>string</TD><TD>'dot'</TD><TD>If showing position, how to show the current position (either 'dot','ellipse', 'rectangle' or 'image' or the name of a function with an @ before it). Note that if showPosition=1, it will always be shown. If showPosition=2 and imagestimulus is used,it will only be shown when in state 1. If showPosition=3, then the fields below will be used to determine the position. If showPosition=4, it is the same as 3, but the position is only shown until the trial starts. If showPosition=5, it is the same as 3, but if using image stimuli, only show position if it is in state 1.If using a function, the function will get called every frame (data can be stored between calls in the thistrial struct): thistrial = yourFunctionName(experimentdata,thistrial,lastpositionVisual,e,frame);</TD></TR>
<TR><TD>showPositionColor</TD><TD>No</TD><TD>cellarray</TD><TD>[192,192,192]</TD><TD>If showing position, the color of the feedback (each number between 0 and 255). Should be a N * (P*3) array (P= number of dots). Can either have one row, or a row for each frame. If showing image, the imagenumber to show. If it is a cell array, then each cell can specify for an individual trial.</TD></TR>
<TR><TD>showPositionSize</TD><TD>No</TD><TD><A title="A matrix (see description for how to fill it)">matrix</A></TD><TD>6</TD><TD>If showing position and showPositionType is a dot, then a 1*P array (with the size of the each dot in pixels. If type is a rectangle, then a 1*(P*2) array (width and height).</TD></TR>
<TR><TD>showPositionRotationCenter</TD><TD>No</TD><TD>cellarray</TD><TD>{0.50 0.50 }</TD><TD>If showing position, the center of rotation (if showPositionRotationAngle is not zero). Should be a P * 2 matrix (p = number of dots), in relative screen coordinates (i.e. between 0 and 1)</TD></TR>
<TR><TD>showPositionRotationAngle</TD><TD>No</TD><TD>cellarray</TD><TD>{NaN }</TD><TD>If showing position, the angle to rotate about the center of rotation (in radians). Should be a P * 1 matrix (p = number of dots), or a cell for each trial with a P*1 matrix</TD></TR>
<TR><TD>startRotationFrame</TD><TD>No</TD><TD><A title="A matrix (see description for how to fill it)">matrix</A></TD><TD>-Inf</TD><TD>If showing position, the frame to start the rotation (if there is one). To start before the trial (i.e. while waiting for start), set to -inf. Should be a 1*P  matrix (p=number of dots) or N*P (one row for each trial).</TD></TR>
<TR><TD>displayRangeX</TD><TD>No</TD><TD>cellarray</TD><TD>{0.00 0.00 0.00 0.00 0.00 }</TD><TD>Range of values to show when using showPosition=3 as the dot position on the x axis. The ith row corresponds to the ith sensor. Use the first two values to show the x values, next two for y. e.g. [-1 1 0 0 0] to show x values of -1 to 1 as the dot x position. Use the last value to show time, e.g. [0 0 0 0 1] will move across the screen in 1 s. If the time (last) value is set to -inf, only show before trial starts. If set to inf, only show during (and not before) trial. This should be a cell array with either a single cell for all trials, or a cell for each trial. To show multiple points, use an M*(N*P) matrix (M sensors, N=2*dims+1, P dots)</TD></TR>
<TR><TD>displayRangeY</TD><TD>No</TD><TD>cellarray</TD><TD>{0.00 0.00 0.00 0.00 0.00 }</TD><TD>Range of values to show when using showPosition=3 as the dot position on the y axis. The ith row corresponds to the ith sensor. Use the first two values to show the x values, next two for y, e.g. [0 0 -10 10 0] to show y values of -0.5 to 0.5 as the dot y position. Use the last value to show time, e.g. [0 0 0 0 1] will move up the screen in 1 s. If the time (last) value is set to -inf, only show before trial starts. If set to inf, only show during (and not before) trial. This should be a cell array with either a single cell for all trials, or a cell for each trial. To show multiple points, use an M*(N*P) matrix (M sensors, N=2*dims+1, P dots)</TD></TR>
<TR><TD>offsetX</TD><TD>No</TD><TD><A title="A matrix (see description for how to fill it)">matrix</A></TD><TD>0.50</TD><TD>x offset when using showPosition.  This can either be a 1*P matrix [P is the number of dots] (same for every trial), or an NxP matrix (one row for each trial).</TD></TR>
<TR><TD>offsetY</TD><TD>No</TD><TD><A title="A matrix (see description for how to fill it)">matrix</A></TD><TD>0.50</TD><TD>y offset when using showPosition.  This can either be a 1*P matrix [P is the number of dots] (same for every trial), or an NxP matrix (one row for each trial).</TD></TR>
<TR><TD>numsensors</TD><TD>Yes</TD><TD><A title="A single number (i.e. not a matrix)">number</A></TD><TD>1</TD><TD>Number of g4 receivers present</TD></TR>
</TABLE></BODY></HTML>